function calculateSum(str) {
    const chars = "abcdefghijklmnopqrstuvwxyz";
    let counter = 0;
    for (let char of str) {
        char = char.toLowerCase();
        if (!isNaN(parseInt(char)) && char.trim()!== '') {
            counter += parseInt(char);
        } else if (chars.includes(char)) {
            counter += chars.indexOf(char);
        }
    }
    return counter;
}
